//文件名：Can_Rrefresh
//功能：处理用户与系统交互的功能
//创建时间：2022年11月17日
//作者：dowson
//email：dowson.tseng@gmail.com


#ifndef __CAN_REFRESH_H__
#define __CAN_REFRESH_H__

#include "system_init.h"

#define Device_TIME_OUT_LOGIN_MAX_NUM 16

typedef enum enum_CanDevice{
    CanDevice_VCU=0,CanDevice_MCU,CanDevice_IP,CanDevice_BMS,CanDevice_ABS,CanDevice_EPS,CanDevice_DCDC
}eCanDevice;

typedef struct struct_DeviceTimeOut
{
    uint8_t oldLifeTime;
    uint8_t newLifeTime;
    uint16_t outTime; //10ms基准
    uint16_t outTimeCount;
    uint8_t deviceState;
    
}tDeviceTimeOut;


void CanDeviceLoginInit(void);
int8_t CanDeviceLogin(eCanDevice canDevice,uint16_t outTime);
void CanDeviceTimeoutcheckMain(uint16_t timeSlice);
int8_t CanDeviceLifeRefresh(eCanDevice canDevice ,uint8_t newLife);
uint8_t IsOnlineCanDevice(eCanDevice canDevice);





#endif

